package com.thingsgrid.device.feign;

import com.thingsgrid.common.constant.CommonConstant;
import com.thingsgrid.device.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(
	//定义feign指向的service-id
	value = CommonConstant.APPLICATION_PRODUCT_NAME
)
public interface IProductClient {
	//接口前缀
	String API_PREFIX = "/api";

	/**
	 * 获取产品信息
	 * @param productId 产品id
	 * @return
	 */
	@GetMapping(API_PREFIX+"/detail")
	Product productInfoById(@RequestParam("productId") String productId);

	/**
	 * 获取产品列表
	 * 09.16
	 */
	@GetMapping(API_PREFIX + "/findProductByTopicId")
	List<Product> findProductByTopicId(@RequestParam("topicId") String topicId);

	/**
	 * 获取用户信息
	 *
	 * @param tenantCode 租户编号
	 * @param account    账号
	 * @return
	 */
	//@GetMapping(USER_INFO)
	//R<UserInfo> userInfo(@RequestParam("tenantCode") String tenantCode, @RequestParam("account") String account);

}
